<?php

$link = mysql_connect('localhost', 'ndhinves_test', 'Test1234');
if (!$link) {
    die('Not connected : ' . mysql_error());
}

// make foo the current db
$db_selected = mysql_select_db('ndhinves_test', $link);
if (!$db_selected) {
    die ('Can\'t use database : ' . mysql_error());
}

$pwd = md5('123456');
$insert_query = "INSERT INTO admins (username,password) VALUES ('viet','$pwd')";
mysql_query($insert_query);


$sql = "SELECT * FROM admins";
$result = mysql_query($sql);

while($row = mysql_fetch_array($result))
{
    $rows[] = $row;
}

echo "<pre>";
print_r($rows);
echo "</pre>";

mysql_close($link);
?>
